package eu.news.interconnect.server;

import java.util.Hashtable;
import java.util.Map;

import eu.news.data.dao.DAOFactory;
import eu.news.data.dao.InterfaceDAO;
import eu.news.data.pojo.Interface;

public class InterfaceMap {
	
	private static Map<String, Interface> map = new Hashtable<String, Interface>();
	
	//TODO enable buffer and add a interface for refresh
	public static Interface getByAccessKey(String key){
		Interface face = null;map.get(key);
		if (face == null){
			InterfaceDAO dao = DAOFactory.getInterfaceDAO();
			face = dao.getByKey(key);
			//if (face != null)
				//map.put(key, face);
		}
		return face;
	}
}
